<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    //map和对象都是键值对的集合
    const m=new Map()
    m.set('name','alex')
    m.set('age',18)
    //对象一般用于字符串当做键
    //基本数据类型和引用数据类型都可以作为map键
    const map=new Map()
    map.set(true,true)
    map.set({},'object')
    map.set(undefined,'undefined')
    console.log(map);
  </script>
</body>
</html>